#include <Engine/StdAfx.h>
#include <Engine/Foundation/Object.h>
#include <Engine/IScene.h>
#include <Engine/IVertexBuffer.h>
#include <Engine/IIndexBuffer.h>
#include <Engine/IMaterial.h>
#include <Engine/IInputLayout.h>
#include <Engine/Renderer/IRenderState.h>

using namespace fastbird;

//----------------------------------------------------------------------------
Object::Object()
	: mScene(0)
{
	mRasterizerState = IRasterizerState::CreateRasterizerState();
	mBlendState = IBlendState::CreateBlendState();
	mBoundingVolume = BoundingVolume::Create();
}

//----------------------------------------------------------------------------
Object::~Object()
{
	if (mScene)
	{
		mScene->DetachObject(this);
		mScene = 0;
	}
}

//----------------------------------------------------------------------------
void Object::OnAttachedToScene(IScene* pScene)
{
	assert(mScene==0);
	mScene = pScene;
}

//----------------------------------------------------------------------------
void Object::OnDetachedFromScene(IScene* pScene)
{
	mScene = 0;
}